#ifndef __LIVE555_MEDIA_CONTROL_HH__
#define __LIVE555_MEDIA_CONTROL_HH__

#if defined( _WIN32 )
#   include <winsock2.h>
#endif

#include <UsageEnvironment.hh>
#include <BasicUsageEnvironment.hh>
#include <GroupsockHelper.hh>
#include <liveMedia.hh>
#include <liveMedia_version.hh>
#include <Base64.hh>

#define msg_Err( p_this, ... ) 
#define msg_Dbg( p_this, ... ) 


/*****************************************************************************
 * Error values (shouldn't be exposed)
 *****************************************************************************/
#define VLC_SUCCESS        (-0) /**< No error */
#define VLC_EGENERIC       (-1) /**< Unspecified error */

class Live555MediaControl 
{
public:
	int seek(int64_t time_us);
	int getCurrTime(int64_t* time_us);
	int getTotalTime(int64_t* time_us);

	int pause(bool b_pause);
	int keepAlive();

public:
	Live555MediaControl();

public: /* for easy access, just change properties to public */
	/* scheduler, environment */    
    TaskScheduler    *scheduler;
    UsageEnvironment *environment;

	/* client, media session, media sub session */
	RTSPClient		 *rtspClient;
	MediaSession     *mediaSession;
	MediaSubsession  *mediaSubSession;   

    /* start, len, pos */
    double           f_npt;
	double           f_npt_start;
    double           f_npt_length;   

    char             event_rtsp;

    bool             b_paused;      /* Are we paused? */
    bool             b_error;
    int              i_live555_ret; /* live555 callback return code */

    float            f_seek_request;/* In case we receive a seek request while paused*/
} ;



#endif